<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<link href="/page/layui/css/layui.css" rel="stylesheet">
<script type="text/javascript" src="/designer/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="/designer/js/vue.js"></script>
<script type="text/javascript" src="/page/layui/layui.js"></script>
<link rel="stylesheet" href="/designer/css/zzsc.css" />
<style>
    li{
        float: left;
    }
</style>
<body>
<div id="app">
    <div class="c2">
        <div class="c2_l0">
            <h3>项目户型图表：</h3>
                    <ul>
                        <li  v-for="floor_plan in designers">
                            &nbsp <a   target="_blank">
                                <img style="margin-left: 10px" width="190" height="200" :src="floor_plan.floorPlan" ><span></span></a>
                        </li>
                    </ul>
        </div>
    </div>
    <br>
    <div class="c2">
        <div class="c2_l0">
            <h3>项目合同表：</h3>
            <ul>
                <li  v-for="contract in contracts">
                    &nbsp <a   target="_blank">
                    <img style="margin-left: 10px" width="190" height="200" :src="contract.contractScanning" ><span></span></a>
                </li>
            </ul>
        </div>
    </div>

    <br>

<div class="c2">
    <div class="c2_l0">
        <h3>项目设计图表：</h3>
        <ul>
            <li  v-for="plan in plans">
                &nbsp <a   target="_blank">
                <img style="margin-left: 10px" width="190" height="200" :src="plan.planDesignPaper" ></a>
            </li>
        </ul>
    </div>
</div>
    <br>
        <div class="c2">
            <div class="c2_l0">
                <h3>项目施工图表：</h3>
                <ul>
                    <li  v-for="construction in constructions">
                        &nbsp <a   target="_blank">
                        <img style="margin-left: 10px" width="190" height="200" :src="construction.constructionProductionDrawing" ></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<button type="button" class="layui-btn layui-btn-fluid" id="audit">通过审核</button>

</body>
<script type="text/javascript">
    //项目编号
    var number=window.location.href.split("?")[1].split("&")[0].split("=")[1];
    //id为项目id
    var id=1;
    var _this;
    var app = new Vue({
        el: "#app",
        data: {
            designers: null,
            contracts:null,
            plans:null,
            constructions:null,
        },
        created: function () {
            _this = this;
            this.selectByFloorPlan();
            this.selectByContract();
            this.selectByPlans();
            this.selectBuConstruction();
        },
        methods: {
            selectByFloorPlan: function () {
                $.ajax({
                    url: "/designer/designer/selectByProjectId",
                    type: "get",
                    data: {"projectNull": number},
                    dataType: "json",
                    success: function (data) {
                        _this.designers = data.list;

                    }
                })
            },
            selectByContract: function () {
                $.ajax({
                    url: "/designer/contract/selectByProjectId",
                    type: "get",
                    data: {"projectNull": number},
                    dataType: "json",
                    success: function (data) {
                        _this.contracts = data.list;

                    }
                })
            },selectByPlans: function () {
                $.ajax({
                    url: "/designer/plan/selectByProjectId",
                    type: "get",
                    data: {"projectNull": number},
                    dataType: "json",
                    success: function (data) {
                        _this.plans = data.list;

                    }
                })
            },selectBuConstruction: function () {
                $.ajax({
                    url: "/designer/construction/selectByProjectId",
                    type: "get",
                    data: {"projectNull": number},
                    dataType: "json",
                    success: function (data) {
                        _this.constructions = data.list;

                    }
                })
            }

        }
    });
    $("#audit").on("click",function () {
        var projectNo = window.location.href.split("?")[1].split("&")[0].split("=")[1]
        layui.use('layer', function(){
            var layer = layui.layer;

        });
        $.ajax({
            url: "/project/project/auditdrawing",
            data: {projectNo: projectNo, eId: 0},
            type: "put",
            dataType: "json",
            success: function () {
                layer.msg("审核完成，即将关闭该页面");
                setTimeout(function () {//设置定时器
                    parent.location.reload(true);//刷新父级页面
                    var index = parent.layer.getFrameIndex(window.name);
                    //获取当前弹窗的Id
                    parent.layer.close(index);
                }, 3000);
            }
        })
    })
</script>
</html>